<?php
/**
 * Created by JetBrains PhpStorm.
 * User: khathirdstep1025
 * Date: 9/27/12
 * Time: 9:54 PM
 * To change this template use File | Settings | File Templates.
 */

class Detail_model extends CI_Model{

    public function get_detail($id){
        $this->db->where('detail_id', $id);
        $query = $this->db->get('detail', 1);
        if ($query->num_rows > 0){
            foreach($query->result() as $row){
                return $row;
            }
        } else {
            return FALSE;
        }
    }

    public function get_detail_product($id){
        $this->db->select('detail_id');
        $query = $this->db->get_where('product_detail', array('product_id' => $id));
        if ($query->num_rows > 0){
            error_log(print_r($query->result_array(), TRUE));
            return $query->result_array();
        } else {
            return FALSE;
        }
    }
}